﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CP2011_Assignment
{
    public partial class EditProductUI : Form
    {
        public EditProductUI()
        {
            InitializeComponent();
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Owner.Show();
            this.Dispose();
        }

        private void EditProductUI_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'assignmentDBDataSet1.Product' table. You can move, or remove it, as needed.
            this.productTableAdapter.Fill(this.assignmentDBDataSet1.Product);

        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            this.Hide();
            try
            {
                EditProductUI2 editProd2 = new EditProductUI2(Convert.ToInt32(txtBoxEnterId.Text));
                editProd2.Owner = this;
                editProd2.Show();
            }
            catch
            {
                MessageBox.Show("Input format is incorrect, please insert only integer value", "Incorrect Input Format",MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.Show();
            }
            
        }
    }
}
